﻿#if !LITE
using System;
using System.Collections.Generic;
using System.Text;

using Elegant.Ui;

namespace iPdf
{
    class OfficePage: ConvertPage
    {
        public OfficePage()
        {
            visibleColumns.Add(TataGrid.Navigator);
        }

        protected override void InstallEventHandlers()
        {
            base.InstallEventHandlers();

            FormatGallery.SelectedItemChanged += new EventHandler<GallerySelectedItemChangedEventArgs>(FormatGallery_SelectedItemChanged);
        }

        private void FormatGallery_SelectedItemChanged(object sender, GallerySelectedItemChangedEventArgs e)
        {
            bool isPdfA = this.FormatGallery.SelectedFormat == PdfCreatorFormat.PDF_A;

            //add or remove to reflect the change
            if (isPdfA)
            {
                visibleColumns.Remove(TataGrid.Hyperlink);
            }
            else
            {
                if (!visibleColumns.Contains(TataGrid.Hyperlink))
                {
                    visibleColumns.Add(TataGrid.Hyperlink);
                }
            }

            Global.MainWindow.UpdateOptionGroup();
            Global.Grid.UpdateCells();
        }
    }
}
#endif